<?php

namespace app\api\validate;

use think\Validate;

class Article extends Validate
{
    protected $rule =   [
        'id|文章ID' => 'require',
        'cate_id|分类ID' => 'require',
        'title|标题'  => 'require',
        'content|内容'   => 'require',
        'score|阅读积分' => 'number|gt:0',
        'type|文章类型' => 'require|in:1,2,3,4'
    ];
    protected $message  =   [];
    protected $scene  =   [
        'edit' => ['id', 'title', 'content'],
        'add' => ['title', 'cate_id', 'content', 'type', 'score']
    ];
}
